home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
X User Tools
/
X User Tools (O'Reilly and Associates)(1994).ISO
/
sun4c
/
archive
/
tcltk.z
/
tcltk
/
man
/
catn
/
winfo.n
< prev
next >
Wrap
Text File
|
1994-09-20
|
13KB
|
331 lines
winfo(n) Tk Commands
_________________________________________________________________
NAME
winfo - Return window-related information
SYNOPSIS
winfo _o_p_t_i_o_n ?_a_r_g _a_r_g ...?
_________________________________________________________________
DESCRIPTION
The winfo command is used to retrieve information about win-
dows managed by Tk. It can take any of a number of dif-
ferent forms, depending on the _o_p_t_i_o_n argument. The legal
forms are:
winfo atom _n_a_m_e
Returns a decimal string giving the integer identifier |
for the atom whose name is _n_a_m_e. If no atom exists |
with the name _n_a_m_e then a new one is created. |
winfo atomname _i_d ||
Returns the textual name for the atom whose integer |
identifier is _i_d. This command is the inverse of the |
winfo atom command. Generates an error if no such atom |
exists. |
winfo cells _w_i_n_d_o_w ||
Returns a decimal string giving the number of cells in |
the color map for _w_i_n_d_o_w.
winfo children _w_i_n_d_o_w
Returns a list containing the path names of all the
children of _w_i_n_d_o_w. Top-level windows are returned as
children of their logical parents.
winfo class _w_i_n_d_o_w
Returns the class name for _w_i_n_d_o_w.
winfo containing _r_o_o_t_X _r_o_o_t_Y
Returns the path name for the window containing the |
point given by _r_o_o_t_X and _r_o_o_t_Y. _R_o_o_t_X and _r_o_o_t_Y are |
specified in screen units (i.e. any form acceptable to |
Tk_GetPixels) in the coordinate system of the root win- |
dow (if a virtual-root window manager is in use then |
the coordinate system of the virtual root window is |
used). If no window in this application contains the |
point then an empty string is returned. In selecting |
the containing window, children are given higher prior- |
ity than parents and among siblings the highest one in |
the stacking order is chosen. |
Tk 1
winfo(n) Tk Commands
winfo depth _w_i_n_d_o_w ||
Returns a decimal string giving the depth of _w_i_n_d_o_w |
(number of bits per pixel). |
winfo exists _w_i_n_d_o_w ||
Returns 1 if there exists a window named _w_i_n_d_o_w, 0 if |
no such window exists. |
winfo fpixels _w_i_n_d_o_w _n_u_m_b_e_r ||
Returns a floating-point value giving the number of |
pixels in _w_i_n_d_o_w corresponding to the distance given by |
_n_u_m_b_e_r. _N_u_m_b_e_r may be specified in any of the forms |
acceptable to Tk_GetScreenMM, such as ``2.0c'' or |
``1i''. The return value may be fractional; for an |
integer value, use winfo pixels.
winfo geometry _w_i_n_d_o_w
Returns the geometry for _w_i_n_d_o_w, in the form
_w_i_d_t_hx_h_e_i_g_h_t+_x+_y. All dimensions are in pixels.
winfo height _w_i_n_d_o_w
Returns a decimal string giving _w_i_n_d_o_w's height in pix-
els. When a window is first created its height will be
1 pixel; the height will eventually be changed by a
geometry manager to fulfill the window's needs. If you
need the true height immediately after creating a
widget, invoke update to force the geometry manager to
arrange it, or use winfo reqheight to get the window's
requested height instead of its actual height.
winfo id _w_i_n_d_o_w
Returns a hexadecimal string indicating the X identif-
ier for _w_i_n_d_o_w.
winfo interps
Returns a list whose members are the names of all Tcl
interpreters (e.g. all Tk-based applications) currently
registered for the display of the invoking application.
winfo ismapped _w_i_n_d_o_w
Returns 1 if _w_i_n_d_o_w is currently mapped, 0 otherwise.
winfo name _w_i_n_d_o_w
Returns _w_i_n_d_o_w's name (i.e. its name within its parent,
as opposed to its full path name). The command winfo |
name . will return the name of the application.
winfo parent _w_i_n_d_o_w
Returns the path name of _w_i_n_d_o_w's parent, or an empty
string if _w_i_n_d_o_w is the main window of the application.
winfo pathname _i_d
Tk 2
winfo(n) Tk Commands
Returns the path name of the window whose X identifier
is _i_d. _I_d must be a decimal, hexadecimal, or octal
integer and must correspond to a window in the invoking
application.
winfo pixels _w_i_n_d_o_w _n_u_m_b_e_r
Returns the number of pixels in _w_i_n_d_o_w corresponding to |
the distance given by _n_u_m_b_e_r. _N_u_m_b_e_r may be specified |
in any of the forms acceptable to Tk_GetPixels, such as |
``2.0c'' or ``1i''. The result is rounded to the |
nearest integer value; for a fractional result, use |
winfo fpixels.
winfo reqheight _w_i_n_d_o_w
Returns a decimal string giving _w_i_n_d_o_w's requested
height, in pixels. This is the value used by _w_i_n_d_o_w's
geometry manager to compute its geometry.
winfo reqwidth _w_i_n_d_o_w
Returns a decimal string giving _w_i_n_d_o_w's requested
width, in pixels. This is the value used by _w_i_n_d_o_w's
geometry manager to compute its geometry.
winfo rgb _w_i_n_d_o_w _c_o_l_o_r
Returns a list containing three decimal values, which |
are the red, green, and blue intensities that |
correspond to _c_o_l_o_r in the window given by _w_i_n_d_o_w. |
_C_o_l_o_r may be specified in any of the forms acceptable |
for a color option.
winfo rootx _w_i_n_d_o_w
Returns a decimal string giving the x-coordinate, in
the root window of the screen, of the upper-left corner
of _w_i_n_d_o_w's border (or _w_i_n_d_o_w if it has no border).
winfo rooty _w_i_n_d_o_w
Returns a decimal string giving the y-coordinate, in
the root window of the screen, of the upper-left corner
of _w_i_n_d_o_w's border (or _w_i_n_d_o_w if it has no border).
winfo screen _w_i_n_d_o_w
Returns the name of the screen associated with _w_i_n_d_o_w,
in the form _d_i_s_p_l_a_y_N_a_m_e._s_c_r_e_e_n_I_n_d_e_x.
winfo screencells _w_i_n_d_o_w
Returns a decimal string giving the number of cells in |
the default color map for _w_i_n_d_o_w's screen. |
winfo screendepth _w_i_n_d_o_w ||
Returns a decimal string giving the depth of the root |
window of _w_i_n_d_o_w's screen (number of bits per pixel). |
Tk 3
winfo(n) Tk Commands
winfo screenheight _w_i_n_d_o_w ||
Returns a decimal string giving the height of _w_i_n_d_o_w's |
screen, in pixels. |
winfo screenmmheight _w_i_n_d_o_w ||
Returns a decimal string giving the height of _w_i_n_d_o_w's |
screen, in millimeters. |
winfo screenmmwidth _w_i_n_d_o_w ||
Returns a decimal string giving the width of _w_i_n_d_o_w's |
screen, in millimeters. |
winfo screenvisual _w_i_n_d_o_w ||
Returns one of the following strings to indicate the |
default visual type for _w_i_n_d_o_w's screen: directcolor, |
grayscale, pseudocolor, staticcolor, staticgray, or |
truecolor. |
winfo screenwidth _w_i_n_d_o_w ||
Returns a decimal string giving the width of _w_i_n_d_o_w's |
screen, in pixels. |
winfo toplevel _w_i_n_d_o_w ||
Returns the path name of the top-level window contain- |
ing _w_i_n_d_o_w. |
winfo visual _w_i_n_d_o_w ||
Returns one of the following strings to indicate the |
visual type for _w_i_n_d_o_w: directcolor, grayscale, pseu- |
docolor, staticcolor, staticgray, or truecolor. |
winfo vrootheight _w_i_n_d_o_w ||
Returns the height of the virtual root window associ- |
ated with _w_i_n_d_o_w if there is one; otherwise returns |
the height of _w_i_n_d_o_w's screen. |
winfo vrootwidth _w_i_n_d_o_w ||
Returns the width of the virtual root window associated |
with _w_i_n_d_o_w if there is one; otherwise returns the |
width of _w_i_n_d_o_w's screen. |
winfo vrootx _w_i_n_d_o_w ||
Returns the x-offset of the virtual root window associ- |
ated with _w_i_n_d_o_w, relative to the root window of its |
screen. This is normally either zero or negative. |
Returns 0 if there is no virtual root window for _w_i_n_- |
_d_o_w. |
winfo vrooty _w_i_n_d_o_w ||
Returns the y-offset of the virtual root window associ- |
ated with _w_i_n_d_o_w, relative to the root window of its |
screen. This is normally either zero or negative. |
Tk 4
winfo(n) Tk Commands
Returns 0 if there is no virtual root window for _w_i_n_- |
_d_o_w.
winfo width _w_i_n_d_o_w
Returns a decimal string giving _w_i_n_d_o_w's width in pix-
els. When a window is first created its width will be
1 pixel; the width will eventually be changed by a
geometry manager to fulfill the window's needs. If you
need the true width immediately after creating a
widget, invoke update to force the geometry manager to
arrange it, or use winfo reqwidth to get the window's
requested width instead of its actual width.
winfo x _w_i_n_d_o_w
Returns a decimal string giving the x-coordinate, in
_w_i_n_d_o_w's parent, of the upper-left corner of _w_i_n_d_o_w's
border (or _w_i_n_d_o_w if it has no border).
winfo y _w_i_n_d_o_w
Returns a decimal string giving the y-coordinate, in
_w_i_n_d_o_w's parent, of the upper-left corner of _w_i_n_d_o_w's
border (or _w_i_n_d_o_w if it has no border).
KEYWORDS
atom, children, class, geometry, height, identifier, infor-
mation, interpreters, mapped, parent, path name, screen,
virtual root, width, window
Tk 5